﻿using System;
using ClusterAwareProperties.Properties;

namespace ClusterAwareProperties
{
    /// <summary>
    /// Constans ClusterAware ResourceTypes
    /// </summary>
    public static class ResourceTypeNamesConstants
    {
        /// <summary>
        /// Default Name to resource type Distributed File System
        /// </summary>
        public const string ResourcetypeDistributedFileSystem = "Distributed File System";
        /// <summary>
        /// Default Name to resource type Distributed Transaction Coordinator
        /// </summary>
        public const string ResourcetypeDtc = "Distributed Transaction Coordinator";
        /// <summary>
        /// Default Name to resource type DHCP Service
        /// </summary>
        public const string ResourcetypeDhcpService = "DHCP Service";
        /// <summary>
        /// Default Name to resource type File Server
        /// </summary>
        public const string ResourcetypeFileServer = "File Server";
        /// <summary>
        /// Default Name to resource type File Share Quorum Witness
        /// </summary>
        public const string ResourcetypeFilesShareWitness = "File Share Witness";
        /// <summary>
        /// Default Name to resource type Generic Applicationm
        /// </summary>
        public const string ResourcetypeGenericApplication = "Generic Application";
        /// <summary>
        /// Default Name to resource type Generic Script
        /// </summary>
        public const string ResourcetypeGenericScript = "Generic Script";
        /// <summary>
        /// Default Name to resource type Generic Service
        /// </summary>
        public const string ResourcetypeGenericService = "Generic Service";
        /// <summary>
        /// Default Name to resource type IPv4 Address
        /// </summary>
        public const string ResourcetypeIpAdress = "IP Address";
        /// <summary>
        /// Default Name to resource type IPv6 Address
        /// </summary>
        public const string ResourcetypeIpv6Adress = "IPv6 Address";
        /// <summary>
        /// Default Name to resource type IPv6 Tunnel Address
        /// </summary>
        public const string ResourcetypeIpv6TunnelAdress = "IPv6 Tunnel Address";
        /// <summary>
        /// Default Name to resource type Microsoft iSNS
        /// </summary>
        public const string ResourcetypeIsns = "Microsoft iSNS";
        /// <summary>
        /// Default Name to resource type Message Queue servive
        /// </summary>
        public const string ResourcetypeMsmq = "MSMQ";
        /// <summary>
        /// Default Name to resource type Message Queue servive triggers
        /// </summary>
        public const string ResourcetypeMsmqTriggers = "MSMQTriggers";
        /// <summary>
        /// Default Name to resource type Network Name
        /// </summary>
        public const string ResourcetypeNetworkName = "Network Name";
        /// <summary>
        /// Default Name to resource type NFS Share
        /// </summary>
        public const string ResourcetypeNfsShare = "NFS Share";
        /// <summary>
        /// Default Name to resource type Physical Disk
        /// </summary>
        public const string ResourcetypePhysicalDisk = "Physical Disk";
        /// <summary>
        /// Default Name to resource type Print Spooler
        /// </summary>
        public const string ResourcetypePrintSpooler = "Print Spooler";
        /// <summary>
        /// Default Name to resource type Volume Shadow Copy Service Task
        /// </summary>
        public const string ResourcetypeVolumeShadowCopy = "Volume Shadow Copy Service Task";
        /// <summary>
        /// Default Name to resource type WINS Service
        /// </summary>
        public const string ResourcetypeWinsService = "WINS Service";

        /// <summary>
        /// Convert string resoruce type to windows resourcetype  enum 
        /// </summary>
        /// <param name="value">string value to converte</param>
        /// <returns>WindowsResourcetype enum</returns>
        /// <remarks>
        /// if resource type string not a windows  resoruce type the return is WindowsResourcetype.CustomUser
        /// </remarks>
        public static WindowsResourcetype ConvertToWindowsResourceType(string value)
        {
            if (value.ToLower() == ResourcetypeDistributedFileSystem.ToLower())
            {
                return WindowsResourcetype.DistributedFileSystem;
            }
            if (value.ToLower() == ResourcetypeDtc.ToLower())
            {
                return WindowsResourcetype.Dtc;
            }
            if (value.ToLower() == ResourcetypeDhcpService.ToLower())
            {
                return WindowsResourcetype.DhcpService;
            }
            if (value.ToLower() == ResourcetypeFileServer.ToLower())
            {
                return WindowsResourcetype.FileServer;
            }
            if (value.ToLower() == ResourcetypeFilesShareWitness.ToLower())
            {
                return WindowsResourcetype.FilesShareWitness;
            }
            if (value.ToLower() == ResourcetypeGenericApplication.ToLower())
            {
                return WindowsResourcetype.GenericApplication;
            }
            if (value.ToLower() == ResourcetypeGenericScript.ToLower())
            {
                return WindowsResourcetype.GenericScript;
            }
            if (value.ToLower() == ResourcetypeGenericService.ToLower())
            {
                return WindowsResourcetype.GenericService;
            }
            if (value.ToLower() == ResourcetypeIpAdress.ToLower())
            {
                return WindowsResourcetype.IpAdress;
            }
            if (value.ToLower() == ResourcetypeIpv6Adress.ToLower())
            {
                return WindowsResourcetype.Ipv6Adress;
            }
            if (value.ToLower() == ResourcetypeIpv6TunnelAdress.ToLower())
            {
                return WindowsResourcetype.Ipv6TunnelAdress;
            }
            if (value.ToLower() == ResourcetypeIsns.ToLower())
            {
                return WindowsResourcetype.Isns;
            }
            if (value.ToLower() == ResourcetypeMsmq.ToLower())
            {
                return WindowsResourcetype.Msmq;
            }
            if (value.ToLower() == ResourcetypeMsmqTriggers.ToLower())
            {
                return WindowsResourcetype.MsmqTriggers;
            }
            if (value.ToLower() == ResourcetypeNetworkName.ToLower())
            {
                return WindowsResourcetype.NetworkName;
            }
            if (value.ToLower() == ResourcetypeNfsShare.ToLower())
            {
                return WindowsResourcetype.NfsShare;
            }
            if (value.ToLower() == ResourcetypePhysicalDisk.ToLower())
            {
                return WindowsResourcetype.PhysicalDisk;
            }
            if (value.ToLower() == ResourcetypePrintSpooler.ToLower())
            {
                return WindowsResourcetype.PrintSpooler;
            }
            if (value.ToLower() == ResourcetypeVolumeShadowCopy.ToLower())
            {
                return WindowsResourcetype.VolumeShadowCopy;
            }
            if (value.ToLower() == ResourcetypeWinsService.ToLower())
            {
                return WindowsResourcetype.WinsService;
            }
            return WindowsResourcetype.CustomUser;
        }

        /// <summary>
        /// Convert windows resourcetype  enum to resource type string
        /// </summary>
        /// <param name="restype">enum type toconverter</param>
        /// <param name="defaultvalue">default value when resourcetype not is as windows resource type</param>
        /// <returns>resource type string</returns>
        public static string ConvertToResourcetypeName(this WindowsResourcetype restype, string defaultvalue)
        {
            switch (restype)
            {
                case WindowsResourcetype.DistributedFileSystem:
                    return ResourcetypeDistributedFileSystem;
                case WindowsResourcetype.Dtc:
                    return ResourcetypeDtc;
                case WindowsResourcetype.DhcpService:
                    return ResourcetypeDhcpService;
                case WindowsResourcetype.FileServer:
                    return ResourcetypeFileServer;
                case WindowsResourcetype.FilesShareWitness:
                    return ResourcetypeFilesShareWitness;
                case WindowsResourcetype.GenericApplication:
                    return ResourcetypeGenericApplication;
                case WindowsResourcetype.GenericScript:
                    return ResourcetypeGenericScript;
                case WindowsResourcetype.GenericService:
                    return ResourcetypeGenericService;
                case WindowsResourcetype.IpAdress:
                    return ResourcetypeIpAdress;
                case WindowsResourcetype.Ipv6Adress:
                    return ResourcetypeIpv6Adress;
                case WindowsResourcetype.Ipv6TunnelAdress:
                    return ResourcetypeIpv6Adress;
                case WindowsResourcetype.Isns:
                    return ResourcetypeIsns;
                case WindowsResourcetype.Msmq:
                    return ResourcetypeMsmq;
                case WindowsResourcetype.MsmqTriggers:
                    return ResourcetypeMsmqTriggers;
                case WindowsResourcetype.NetworkName:
                    return ResourcetypeNetworkName;
                case WindowsResourcetype.NfsShare:
                    return ResourcetypeNfsShare;
                case WindowsResourcetype.PhysicalDisk:
                    return ResourcetypePhysicalDisk;
                case WindowsResourcetype.PrintSpooler:
                    return ResourcetypePrintSpooler;
                case WindowsResourcetype.VolumeShadowCopy:
                    return ResourcetypeVolumeShadowCopy;
                case WindowsResourcetype.WinsService:
                    return ResourcetypeWinsService;
                default:
                    return defaultvalue;
            }
        }
    }

    /// <summary>
    /// Enum Default windows Resource types 
    /// </summary>
    public enum WindowsResourcetype
    {
        /// <summary>
        /// Resource type created by user
        /// </summary>
        CustomUser,
        /// <summary>
        /// Distributed File System
        /// </summary>
        DistributedFileSystem,
        /// <summary>
        /// Distributed Transaction Coordinator
        /// </summary>
        Dtc,
        /// <summary>
        /// DHCP Service
        /// </summary>
        DhcpService,
        /// <summary>
        /// File Server
        /// </summary>
        FileServer,
        /// <summary>
        /// File Share Quorum Witness
        /// </summary>
        FilesShareWitness,
        /// <summary>
        /// Generic Application
        /// </summary>
        GenericApplication,
        /// <summary>
        /// Generic Script
        /// </summary>
        GenericScript,
        /// <summary>
        /// Generic Service
        /// </summary>
        GenericService,
        /// <summary>
        /// IpV4 Adress
        /// </summary>
        IpAdress,
        /// <summary>
        /// IpV6 Adress
        /// </summary>
        Ipv6Adress,
        /// <summary>
        /// IPv6 Tunnel Address
        /// </summary>
        Ipv6TunnelAdress,
        /// <summary>
        /// iSNSClusRes 
        /// </summary>
        Isns,
        /// <summary>
        /// Microsoft Message Queue servive
        /// </summary>
        Msmq,
        /// <summary>
        /// Microsoft Message Queue triggers
        /// </summary>
        MsmqTriggers,
        /// <summary>
        /// Network Name
        /// </summary>
        NetworkName,
        /// <summary>
        /// NFS Share
        /// </summary>
        NfsShare,
        /// <summary>
        /// Phisical Disk
        /// </summary>
        PhysicalDisk,
        /// <summary>
        ///Printer Spoller
        /// </summary>
        PrintSpooler,
        /// <summary>
        /// Volume Shadow Copy Service Task
        /// </summary>
        VolumeShadowCopy,
        /// <summary>
        /// WINS Servive
        /// </summary>
        WinsService
    }


    /// <summary>
    /// Enum Event Object Type
    /// </summary>
    public enum ObjectTypeEvent
    {
        /// <summary>
        /// Unknown object 
        /// </summary>
        Unknown = -1,
        /// <summary>
        /// Handle Object
        /// </summary>
        Handle = 0,
        /// <summary>
        /// Cluster Object
        /// </summary>
        Cluster = 1,
        /// <summary>
        /// Node Object
        /// </summary>
        Node = 2,
        /// <summary>
        /// Group Object
        /// </summary>
        Group = 3,
        /// <summary>
        /// Resource Object
        /// </summary>
        Resources = 4,
        /// <summary>
        /// Resourcetype Object
        /// </summary>
        ResourceType = 5,
        /// <summary>
        /// Netowrk Object
        /// </summary>
        Network = 6,
        /// <summary>
        /// NetworkInterface Object
        /// </summary>
        NetworkInterface = 7,
        /// <summary>
        /// Registry Object
        /// </summary>
        Registry = 8,
        /// <summary>
        /// Quorum Object
        /// </summary>
        Quorum = 9
    }

    /// <summary>
    /// Enum Node Cluster State
    /// </summary>
    public enum NodeClusterState
    {
        /// <summary>
        /// Unknown State 
        /// </summary>
        Unknown = -1,
        /// <summary>
        /// The Cluster service is not installed on the node.
        /// </summary>
        NotInstalled = 0,
        /// <summary>
        /// The Cluster service is installed on the node but has not yet been configured.
        /// </summary>
        NotConfigured = 1,
        /// <summary>
        /// The Cluster service is installed and configured on the node but is not currently running.
        /// </summary>
        InstalledNotConfigured = 3,
        /// <summary>
        /// The Cluster service is installed, configured, and running on the node
        /// </summary>
        Running = 19
    }

    /// <summary>
    /// Enum Security Level
    /// </summary>
    public enum LevelSecurity
    {
        /// <summary>
        /// Unknown Security Level or not suported
        /// </summary>
        Unknown = -1,
        /// <summary>
        /// Clear Text Level
        /// </summary>
        ClearText = 0,
        /// <summary>
        /// Sign Level
        /// </summary>
        Sign = 1,
        /// <summary>
        /// Encrypt Level
        /// </summary>
        Encrypt = 2


    }

    /// <summary>
    /// Enum Ignore Persistent State Statup
    /// </summary>
    public enum IgnorePersistentState
    {
        /// <summary>
        /// Unknown Ignore Persistent State Statup or not suported
        /// </summary>
        Unknown = -1,
        /// <summary>
        /// On startup groups that were online when the cluster was shut down will be brought online. This is the default value.
        /// </summary>
        BroughtOnline = 0,
        /// <summary>
        /// On startup all groups will remain offline.
        /// </summary>
        RemainOffline = 1
    }

    /// <summary>
    /// Enum Enabled Shared Volumes
    /// </summary>
    public enum SharedVolumes
    {
        /// <summary>
        /// Unknown Shared Volumes or not suported
        /// </summary>
        Unknown = -1,
        /// <summary>
        /// Disabled Shared Volumes
        /// </summary>
        Disabled = 0,
        /// <summary>
        /// Enabled Shared Volumes
        /// </summary>
        Enabled = 1
    }

    /// <summary>
    /// Enum Fix Quorum State
    /// </summary>
    public enum FixQuorumState
    {
        /// <summary>
        /// Unknown Fix Quorum State or not suported
        /// </summary>
        Unknown,
        /// <summary>
        /// The cluster is not in a fix quorum state. This is the default value.
        /// </summary>
        NotFixQuorumState = 0,
        /// <summary>
        /// The cluster is in a fix quorum state.
        /// </summary>
        FixQuorumState = 1
    }

    ///<summary>
    /// Enum Quorum Type
    ///</summary>
    public enum QuorumTypeEnum
    {
        /// <summary>
        /// Unknown Quorum Type or not suported
        /// </summary>
        Unknown,
        /// <summary>
        /// Majority Quorum
        /// </summary>
        Majority,
        /// <summary>
        /// No Majority Quorum
        /// </summary>
        NoMajority
    }

    /// <summary>
    /// Enum Operation System
    /// </summary>
    public enum WindowsOperationSystem
    {
        /// <summary>
        /// Unknown Version
        /// </summary>
        Unknown,
        /// <summary>
        /// Version 2003
        /// </summary>
        Windows2003,
        /// <summary>
        /// Version 2003R2
        /// </summary>
        Windows2003R2,
        /// <summary>
        /// Version 2008
        /// </summary>
        Windows2008,
        /// <summary>
        /// Version 2008R2
        /// </summary>
        Windows2008R2
    }

    /// <summary>
    /// Enum Return code to ConfigManagerErrorCode NetworkInterface
    /// </summary>
    public enum ConfigManagerErrorCode
    {
        /// <summary>
        /// Not found ErrorCode
        /// </summary>
        Unknown = -1,
        /// <summary>
        /// The network interface is working properly.\
        /// </summary>
        WorkingProperly = 0,
        /// <summary>
        /// The network interface is not configured correctly.
        /// </summary>
        NotConfiguredCorrectly = 1,
        /// <summary>
        /// Windows cannot load the driver for the network interface.
        /// </summary>
        CannotLoadDriver = 2,
        /// <summary>
        /// The driver for the network interface might be corrupted, or the system may be low on memory or other resources.
        /// </summary>
        DriveCorrupedOrLowMemory = 3,
        /// <summary>
        /// The network interface is not working properly. One of its drivers or the registry might be corrupted.
        /// </summary>
        NoWorkingProperltOrRegisterCorruped = 4,
        /// <summary>
        /// The driver for the network interface requires a resource that Windows cannot manage.
        /// </summary>
        WindowsNotManagerResource = 5,
        /// <summary>
        /// Boot configuration for the network interface conflicts with other devices
        /// </summary>
        BootConfigurationWithOtherDevice = 6,
        /// <summary>
        /// Cannot filter.
        /// </summary>
        CannotFilter = 7,
        /// <summary>
        /// The driver loader for the network interface is missing.
        /// </summary>
        DriveLoaderMissing = 8,
        /// <summary>
        /// The network interface is not working properly; the controlling firmware is incorrectly reporting the resources for the device.
        /// </summary>
        FirmwareIncorrectlyResource = 9,
        /// <summary>
        /// The network interface cannot start.
        /// </summary>
        CannotStart = 10,
        /// <summary>
        /// The network interface failed.
        /// </summary>
        Failed = 11,
        ///<summary>
        /// The network interface cannot find enough free resources to use.
        ///</summary>
        NotEnoughFreeResources = 12,
        ///<summary>
        /// Windows cannot verify the network interface's resources.
        ///</summary>
        CannoVerifyNetworkResources = 13,
        /// <summary>
        /// The network interface cannot work properly until the computer is restarted.
        /// </summary>
        WaintingComputerRestarted = 14,
        /// <summary>
        /// The network interface is not working properly due to a possible re-enumeration problem.
        /// </summary>
        PossibleReenumerationProblem = 15,
        /// <summary>
        /// Windows cannot identify all of the resources that the network interface uses.
        /// </summary>
        CannotIdentifyAllResources = 16,
        /// <summary>
        /// The network interface is requesting an unknown resource type.
        /// </summary>
        RequestingUnknownResource = 17,
        /// <summary>
        /// The network interface device drivers must be reinstalled.
        /// </summary>
        DriversMustbeReinstalled = 18,
        /// <summary>
        /// Failure using the VxD loader.
        /// </summary>
        FailureVxDLoader = 19,
        /// <summary>
        /// The registry might be corrupted.
        /// </summary>
        RegisterCorrupeted = 20,
        /// <summary>
        /// System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the network interface.
        /// </summary>
        SystemFailuredRemovingNetowrk = 21,
        /// <summary>
        /// The network interface is disabled.
        /// </summary>
        NetowrkDisabled = 22,
        /// <summary>
        /// System failure. If changing the network interface device driver is ineffective, see the hardware documentation.
        /// </summary>
        SystemFailuredDirveIneffective = 23,
        /// <summary>
        /// The network interface is not present, not working properly, or does not have all of its drivers installed.
        /// </summary>
        NetworkNotPresent = 24,
        /// <summary>
        /// Windows is still setting up the network interface.
        /// </summary>
        StillSettingUpNetwork1 = 25,
        /// <summary>
        /// Windows is still setting up the network interface.
        /// </summary>
        StillSettingUpNetwork2 = 26,
        /// <summary>
        /// The network interface does not have valid log configuration.
        /// </summary>
        NotValidConfiguration = 27,
        /// <summary>
        /// The network interface device drivers are not installed.
        /// </summary>
        DriveNotInstalled = 28,
        /// <summary>
        /// The network interface is disabled; the device firmware did not provide the required resources.
        /// </summary>
        NetworkDisabledAndFirmwareNotProvideResoruce = 29,
        /// <summary>
        /// The network interface is using an IRQ resource that another device is using.
        /// </summary>
        IrqResourceUsedAnotherDevive = 30,
        /// <summary>
        /// The network interface is not working properly; Windows cannot load the required device drivers.
        /// </summary>
        WindowsCannotLoadDeive = 31
    }

    /// <summary>
    /// Enum State NetworkInterface
    /// </summary>
    public enum StateNetworkInterface
    {
        /// <summary>
        /// NetworkInterface State Unknown 
        /// </summary>
        StateUnknown = -1,
        /// <summary>
        /// NetworkInterface Unavailable
        /// </summary>
        Unavailable = 0,
        /// <summary>
        /// NetworkInterface Failed
        /// </summary>
        Failed = 1,
        /// <summary>
        /// NetworkInterface Unreachable
        /// </summary>
        Unreachable = 2,
        /// <summary>
        /// NetworkInterface Started and Up
        /// </summary>
        Up = 3
    }

    /// <summary>
    /// Enum StatusInfo Network interface
    /// </summary>
    public enum StatusInfoNetwork
    {
        /// <summary>
        /// Other Status for Network
        /// </summary>
        Other = 1,
        /// <summary>
        /// Unknown STattus for Network
        /// </summary>
        Unknown = 2,
        /// <summary>
        /// Network Enebaled
        /// </summary>
        Enabled = 3,
        /// <summary>
        /// Network Disabled
        /// </summary>
        Disabled = 4,
        /// <summary>
        /// Not aplicable stattus for this Network
        /// </summary>
        NotApplicable = 5
    }

    /// <summary>
    /// Enum Availability Network interface
    /// </summary>
    public enum AvailabilityNetwork
    {
        /// <summary>
        /// The network interface availability is in another state.
        /// </summary>
        Other = 1,
        /// <summary>
        /// The network interface availability is unknown.
        /// </summary>
        Unknown = 2,
        /// <summary>
        /// The network interface is available at full power.
        /// </summary>
        RunningFullPower = 3,
        /// <summary>
        /// The network interface is in a warning state.
        /// </summary>
        Warning = 4,
        /// <summary>
        /// The network interface is in a test state.
        /// </summary>
        InTest = 5,
        /// <summary>
        /// The network interface availability is not applicable.
        /// </summary>
        NotApplicable = 6,
        /// <summary>
        /// The network interface is powered off.
        /// </summary>
        PowerOff = 7,
        /// <summary>
        /// The network interface is offline.
        /// </summary>
        OffLine = 8,
        /// <summary>
        /// The network interface is off duty.
        /// </summary>
        OffDuty = 9,
        /// <summary>
        /// The network interface availability is degraded.
        /// </summary>
        Degraded = 10,
        /// <summary>
        /// The network interface is not installed.
        /// </summary>
        NotInstalled = 11,
        /// <summary>
        /// The network interface is not installed properly.
        /// </summary>
        InstallError = 12,
        /// <summary>
        /// The network interface availability is known to be in a power save mode, but its exact status is unknown.
        /// </summary>
        PowerSaveUnknown = 13,
        /// <summary>
        /// The network interface is in a power save state but still functioning, and may exhibit degraded performance.
        /// </summary>
        PowerSaveLowPowerMode = 14,
        /// <summary>
        /// The network interface is not functioning but could be brought to full power quickly.
        /// </summary>
        PowerSaveStandby = 15,
        /// <summary>
        /// The network interface is being power cycled.
        /// </summary>
        PowerCycle = 16,
        /// <summary>
        /// The network interface is in a warning state but also in a power save mode.
        /// </summary>
        PowerSaveWarning = 17,
        /// <summary>
        /// The network interface is paused.
        /// </summary>
        Paused = 18,
        /// <summary>
        /// The network interface is not ready.
        /// </summary>
        NotReady = 19,
        /// <summary>
        /// The network interface is not configured.
        /// </summary>
        NotConfigured = 20,
        /// <summary>
        /// The network interface is quiesced.
        /// </summary>
        Quiesced = 21
    }

    /// <summary>
    /// Enum State Network
    /// </summary>
    public enum StateNetwork
    {
        /// <summary>
        /// The operation was not successful.
        /// </summary>
        Unknown = 1,
        /// <summary>
        /// All of the network interfaces on the network are unavailable, which means that the nodes that own the network interfaces are down.
        /// </summary>
        Unavailable = 0,
        /// <summary>
        /// The network is not operational; none of the nodes on the network can communicate.
        /// </summary>
        Down = 1,
        /// <summary>
        /// The network is operational, but two or more nodes on the network cannot communicate. Typically a path-specific problem has occurred.
        /// </summary>
        Partitioned = 2,
        /// <summary>
        /// The network is operational; all of the nodes in the cluster can communicate.
        /// </summary>
        Up = 3
    }

    /// <summary>
    /// Enum Roles Network
    /// </summary>
    public enum RolesNetwork
    {
        /// <summary>
        /// The network is not used by the cluster.
        /// </summary>
        None = 0,
        /// <summary>
        /// The network is used to carry internal cluster communication.
        /// </summary>
        Cluster = 1,
        /// <summary>
        /// Not supported.Windows Server 2003 and Windows 2000 Server:  
        /// The network is used to connect client systems to the cluster.
        /// </summary>
        Client = 2,
        /// <summary>
        /// The network is used to connect client systems and to carry internal cluster communication.
        /// </summary>
        Both = 3
    }

    /// <summary>
    /// Enum Characteristis Network
    /// </summary>
    public enum CharacteristisNetwork
    {
        /// <summary>
        /// The Network Interface has no known characteristics.
        /// </summary>
        Unknown = 0x00000000,
        /// <summary>
        /// Resources of this type cannot be deleted unless all nodes are active.
        /// </summary>
        DeleteRequiresAllNodes = 0x00000002,
        /// <summary>
        /// The resource DLL will receive the CLUSCTL_RESOURCE_STATE_CHANGE_REASON control code.
        /// </summary>
        RequiresStateChangeReason = 0x00000010,
        /// <summary>
        /// Only one instance of this resource type is allowed in a cluster.
        /// Windows Server 2003:  This characteristic is not supported. 
        /// </summary>
        SingleClusterInstance = 0x00000040,
        /// <summary>
        /// Only one instance of this resource type is allowed in a group.
        /// Windows Server 2003:  This characteristic is not supported. 
        /// </summary>
        SingleGroupInstance = 0x00000080
    }

    /// <summary>
    /// Enum Dynamic Enum ResourceType
    /// </summary>
    [Serializable]
    public enum DynamicResourceType
    {
        /// <summary>
        /// Unknow resourcetype
        /// </summary>
        Unknown = -1
    }

    /// <summary>
    /// Enum Characteristis ResourceType
    /// </summary>
    public enum CharacteristisResourceType
    {
        /// <summary>
        /// Resources of this type have no known characteristics.
        /// </summary>
        Unknown = 0x00000000,
        /// <summary>
        /// Resources of this type are capable of being the quorum resource type for a cluster.
        /// </summary>
        Quorum = 0x00000001,
        /// <summary>
        /// Resources of this type cannot be deleted unless all nodes are active.
        /// </summary>
        DeleteRequiresAllNodes = 0x00000002,
        /// <summary>
        /// Only one instance of this resource type is allowed in a cluster.
        /// </summary>
        /// <remarks>
        /// Windows Server 2003:  This characteristic is not supported. 
        /// </remarks>
        SingleClusterInstance = 0x00000040,
        /// <summary>
        /// Only one instance of this resource type is allowed in a group.
        /// </summary>
        /// <remarks>
        /// Windows Server 2003:  This characteristic is not supported. 
        /// </remarks>
        SingleGroupInstance = 0x00000080
    }

    /// <summary>
    /// Enum Characteristics Node
    /// </summary>
    public enum CharacteristicsNode
    {
        /// <summary>
        ///The Network Interface has no known characteristics.
        /// </summary>
        Unknown = 0x00000000,
        /// <summary>
        ///Resources of this type cannot be deleted unless all nodes are active.
        /// </summary>
        DeleteRequiresAllNodes = 0x00000002,
        /// <summary>
        /// The resource DLL will receive the CLUSCTL_RESOURCE_STATE_CHANGE_REASON control code.
        /// </summary>
        RequiresStateChangeReason = 0x00000010,
        /// <summary>
        /// Only one instance of this resource type is allowed in a cluster.Windows Server 2003:  This characteristic is not supported. 
        /// </summary>
        SingleClusterInstance = 0x00000040,
        /// <summary>
        /// Only one instance of this resource type is allowed in a group.Windows Server 2003:  This characteristic is not supported. 
        /// </summary>
        SingleGroupInstance = 0x00000080
    }

    /// <summary>
    /// Enum Node State
    /// </summary>
    public enum NodeState
    {
        /// <summary>
        /// The operation was not successful. For more information about the error, call the function GetLastError.
        /// </summary>
        Unknown = -1,
        /// <summary>
        /// The node is physically plugged in, turned on, booted, and capable of executing programs. This value is also used by the SetClusterServiceAccountPassword function and Resume method.
        /// </summary>
        Up = 0,
        /// <summary>
        /// The node is turned off or not operational.
        /// </summary>
        Down = 1,
        /// <summary>
        /// The node is running but not participating in cluster operations. This value is also used by the PauseClusterNode and SetClusterServiceAccountPassword functions. This value is also used Pause method.
        /// </summary>
        Paused = 2,
        /// <summary>
        /// The node is in the process of joining a cluster.
        /// </summary>
        Joining = 3
    }

    /// <summary>
    /// Enum Reset Capacity.  the unitary computer system can be reset with hardware 
    /// </summary>
    public enum NodeResetCapability
    {
        /// <summary>
        /// Computer system can be reset with ohter option.
        /// </summary>
        Other = 1,
        /// <summary>
        /// Computer system Unknown reset option.
        /// </summary>
        Unknown = 2,
        /// <summary>
        /// Computer system disabled reset option.
        /// </summary>
        Disabled = 3,
        /// <summary>
        /// Computer system enabled reset option.
        /// </summary>
        Enabled = 4,
        /// <summary>
        /// Computer system not implement reset option.
        /// </summary>
        NotImplemented = 5
    }

    /// <summary>
    /// Enum Power State
    /// </summary>
    public enum PowerState
    {
        /// <summary>
        /// System power state is unknown.
        /// </summary>
        Unknown = 0,
        /// <summary>
        /// System is in a full power state.
        /// </summary>
        FullPower = 1,
        /// <summary>
        /// System is in a power-save state and still functioning but may exhibit degraded performance.
        /// </summary>
        LowPowerMode = 2,
        /// <summary>
        /// System is not functioning but could be brought to full power quickly.
        /// </summary>
        Standby = 3,
        /// <summary>
        /// System is known to be in a power-save mode but its exact status is unknown.
        /// </summary>
        PowerUnknown = 4,
        /// <summary>
        /// System power is being cycled.
        /// </summary>
        PowerCycle = 5,
        /// <summary>
        /// System power is off.
        /// </summary>
        PowerOff = 6,
        /// <summary>
        /// System is in a warning state and also in a power-save mode.
        /// </summary>
        Warning = 7,
        /// <summary>
        /// System is in a hibernate state and also in a power-save mode.
        /// </summary>
        Hibernate = 8,
        /// <summary>
        /// System is in a soft off power state and also in a power-save mode.
        /// </summary>
        SoftOff = 9,
    }

    /// <summary>
    /// Enum Power Capacity
    /// </summary>
    public enum PowerCapacity
    {
        /// <summary>
        /// The power management features are currently unknown.
        /// </summary>
        Unknown = 0,
        /// <summary>
        /// The power management features are currently not supported.
        /// </summary>
        NotSupported = 1,
        /// <summary>
        /// The power management features are currently disabled.
        /// </summary>
        Disabled = 2,
        /// <summary>
        /// The power management features are currently enabled but the exact feature set is unknown or the information is unavailable.
        /// </summary>
        Enabled = 3,
        /// <summary>
        /// The device can change its power state based on usage or other criteria.
        /// </summary>
        PowerEnteredAutomatically = 4,
        /// <summary>
        /// The SetPowerState method is supported. This method is found on the parent CIM_LogicalDevice class and can be implemented. For more information, see Designing Managed Object Format (MOF) Classes.
        /// </summary>
        PowerStateSettable = 5,
        /// <summary>
        /// The SetPowerState method can be invoked with the PowerState parameter set to 5 (Power Cycle).
        /// </summary> 
        PowerCyclingSupported = 6,
        /// <summary>
        /// The SetPowerState method can be invoked with the PowerState parameter set to 5 (Power Cycle) and Time set to a specific date and time, or interval, for power-on.
        /// </summary>
        PowerTimedPowerOnSupported = 7
    }

    /// <summary>
    /// Enum Node Dedicated purpose
    /// </summary>
    public enum NodeDedicated
    {
        /// <summary>
        /// Not Dedicated
        /// </summary>
        NotDedicated = 0,
        /// <summary>
        /// Unknown purpose
        /// </summary>
        Unknown = 1,
        /// <summary>
        /// Other purpose
        /// </summary>
        Other = 2,
        /// <summary>
        /// Storage purpose
        /// </summary>
        Storage = 3,
        /// <summary>
        /// Router purpose
        /// </summary>
        Router = 4,
        /// <summary>
        /// Switch purpose
        /// </summary>
        Switch = 5,
        /// <summary>
        /// Layer 3 switch purpose
        /// </summary>
        Layer3Switch = 6,
        /// <summary>
        /// Central Office purpose
        /// </summary>
        CentralOfficeSwitch = 7,
        /// <summary>
        /// Hub purpose
        /// </summary>
        Hub = 8,
        /// <summary>
        /// Access Server purpose
        /// </summary>
        AccessServer = 9,
        /// <summary>
        /// Firewall purpose
        /// </summary>
        Firewall = 10,
        /// <summary>
        /// Print purpose
        /// </summary>
        Print = 11,
        /// <summary>
        /// I/O purpose
        /// </summary>
        InputOutput = 12,
        /// <summary>
        /// Web Caching purpose
        /// </summary>
        WebCaching = 13
    }

    /// <summary>
    /// Enum Node NameFormat
    /// </summary>
    public enum NameFormat
    {
        /// <summary>
        /// Not Rules mapping
        /// </summary>
        NotRulesmapped,
        /// <summary>
        /// Rules mapping to IP format
        /// </summary>
        Ip,
        /// <summary>
        /// Rules mapping to Dial format
        /// </summary>
        Dial,
        /// <summary>
        /// Rules mapping to HID format
        /// </summary>
        Hid,
        /// <summary>
        /// Rules mapping to NWA link format
        /// </summary>
        Nwa,
        /// <summary>
        /// Rules mapping to HWA format
        /// </summary>
        Hwa,
        /// <summary>
        /// Rules mapping to X25 format
        /// </summary>
        X25,
        /// <summary>
        /// Rules mapping to ISDN format
        /// </summary>
        Isdn,
        /// <summary>
        /// Rules mapping to IPX format
        /// </summary>
        Ipx,
        /// <summary>
        /// Rules mapping to DCC format
        /// </summary>
        Dcc,
        /// <summary>
        /// Rules mapping to IDC format
        /// </summary>
        Icd,
        /// <summary>
        /// Rules mapping to E.164 format
        /// </summary>
        E164,
        /// <summary>
        /// Rules mapping to SNA format
        /// </summary>
        Sna,
        /// <summary>
        /// Rules mapping to OID/OSI format
        /// </summary>
        Oidosi,
        /// <summary>
        /// Rules mapping to  other format
        /// </summary>
        Other
    }

    /// <summary>
    /// Enum GroupType
    /// </summary>
    public enum GroupType
    {
        /// <summary>
        /// Unkwnow group
        /// </summary>
        Unknown = 9999,
        /// <summary>
        /// File server group
        /// </summary>
        FileServer = 100,
        /// <summary>
        /// Print server group
        /// </summary>
        PrintServer = 101,
        /// <summary>
        /// DHCP server group
        /// </summary>
        DhcpServer = 102,
        /// <summary>
        /// DTC group
        /// </summary>
        Dtc = 103,
        /// <summary>
        /// MSMQ group
        /// </summary>
        Msmq = 104,
        /// <summary>
        /// WINS group
        /// </summary>
        Wins = 105,
        /// <summary>
        /// DFS stand alone group
        /// </summary>
        StandAloneDfs = 106,
        /// <summary>
        /// Generic application group
        /// </summary>
        GenericApplication = 107,
        /// <summary>
        /// Generic service group
        /// </summary>
        GenericService = 108,
        /// <summary>
        /// Generic script group
        /// </summary>
        GenericScript = 109,
        /// <summary>
        /// SCSI name service group
        /// </summary>
        ScsiNameService = 110,
        /// <summary>
        /// Virtual Machine group
        /// </summary>
        VirtualMachine = 111,
        /// <summary>
        /// TS Session broker group
        /// </summary>
        TsSessionBroker = 112
    }

    /// <summary>
    /// Enum State Group
    /// </summary>
    public enum StateGroupResources
    {
        /// <summary>
        /// Group unknow state
        /// </summary>
        StateUnknown = -1,
        /// <summary>
        /// Group is on-line
        /// </summary>
        Online = 0,
        /// <summary>
        /// Group is off-line
        /// </summary>
        Offline = 1,
        /// <summary>
        /// Group failed state
        /// </summary>
        Failed = 2,
        /// <summary>
        /// Group is partial on-line
        /// </summary>
        PartialOnline = 3,
        /// <summary>
        /// Group in pending state
        /// </summary>
        Pending = 4
    }

    /// <summary>
    /// Enum State Group
    /// </summary>
    public enum StateResources
    {
        /// <summary>
        /// Not defined resource state
        /// </summary>
        StateUnknown = -1,
        /// <summary>
        /// Resource unknow state
        /// </summary>
        Unknown = 0,
        /// <summary>
        /// Resource initializing state
        /// </summary>
        Initializing = 1,
        /// <summary>
        /// Resource is on-line
        /// </summary>
        Online = 2,
        /// <summary>
        /// Resource is off-line
        /// </summary>
        Offline = 3,
        /// <summary>
        /// Resource failed state
        /// </summary>
        Failed = 4,
        /// <summary>
        /// Resource pending state
        /// </summary>
        Pending = 128,
        /// <summary>
        /// Resource is on-line pending state
        /// </summary>
        OnlinePending = 129,
        /// <summary>
        /// Resource is off-line pending state
        /// </summary>
        OfflinePending = 130
    }

    /// <summary>
    /// Enum Characteristics Group
    /// </summary>
    /// 
    public enum CharacteristicsGroup
    {
        /// <summary>
        /// The Network Interface has no known characteristics.
        /// </summary>
        Unknown = 0x00000000,
        /// <summary>
        /// Resources of this type cannot be deleted unless all nodes are active.
        /// </summary>
        RequiresAllNodes = 0x00000002,
        /// <summary>
        /// The resource DLL will receive the CLUSCTL_RESOURCE_STATE_CHANGE_REASON control code.
        /// </summary>
        RequiresStateChangeReason = 0x00000010,
        /// <summary>
        /// Only one instance of this resource type is allowed in a cluster.
        /// </summary>
        /// <remarks>Windows Server 2003:  This characteristic is not supported.</remarks>
        SingleClusterInstance = 0x00000040,
        /// <summary>
        /// Only one instance of this resource type is allowed in a group.
        /// </summary>
        /// <remarks>Windows Server 2003:  This characteristic is not supported.</remarks>
        SingleGroupInstance = 0x00000080
    }

    /// <summary>
    /// Enum Characteristics Group
    /// </summary>
    public enum CharacteristicsResource
    {
        /// <summary>
        /// The resource has no known characteristics.
        /// </summary>
        Unknown = 0x00000000,
        /// <summary>
        /// The resource can be selected as the quorum resource for the cluster.
        /// </summary>
        Quorum = 0x00000001,
        /// <summary>
        /// The resource cannot be deleted unless all nodes are active.
        /// </summary>
        DeleteRequiresAllNodes = 0x00000002,
        /// <summary>
        /// The resource can be selected as the quorum resource in clusters configured using the -localquorum switch.
        /// </summary>
        LocalQuorum = 0x00000004,
        /// <summary>
        /// The resource DLL will receive the CLUSCTL_RESOURCE_STATE_CHANGE_REASON control code.
        /// </summary>
        RequiresStateChangeReason = 0x00000010,
        /// <summary>
        /// Only one instance of this resource type is allowed in a cluster.
        /// </summary>
        /// <remarks>
        /// This characteristic is not supported in WINDOWS 2003
        /// </remarks>
        SingleClusterInstance = 0x00000040,
        /// <summary>
        /// Only one instance of this resource type is allowed in a group.
        /// </summary>
        /// <remarks>
        /// This characteristic is not supported in WINDOWS 2003
        /// </remarks>
        SingleGroupInstance = 0x00000080
    }

    /// <summary>
    /// enum Restart Action Resource
    /// </summary>
    public enum RestartAct
    {
        /// <summary>
        /// Resoruce unknow restart action
        /// </summary>
        StateUnknown = -1,
        /// <summary>
        /// Do not restart the resource after a failure.
        /// </summary>
        NotRestart = 0,
        /// <summary>
        /// After Restart  exceeds its restart threshold within its restart period if the resource fails,
        /// do not attempt to failover the group to another node in the cluster.
        /// </summary>
        AfterFailure = 1,
        /// <summary>
        /// After Restart  exceeds its restart threshold within its restart period if the resource fails,
        /// attempt to fail over the group to another node in the cluster.
        /// This is as default value.
        /// </summary>
        AfterFailureThreshold = 2
    }

    /// <summary>
    /// Enum Status Resources
    /// </summary>
    public enum StatusResource
    {
        /// <summary>
        /// Unknow status.
        /// </summary>
        Unknown = 0,
        /// <summary>
        ///  Current status OK
        /// </summary>
        Ok = 1,
        /// <summary>
        ///  Current status Error
        /// </summary>
        Error = 2,
        /// <summary>
        /// Current status degraded
        /// </summary>
        Degraded = 3,
        /// <summary>
        /// Current status pre-failed
        /// </summary>
        PredFail = 4,
        /// <summary>
        /// Current status Stating
        /// </summary>
        Starting = 5,
        /// <summary>
        /// Current status Stoping
        /// </summary>
        Stopping = 6,
        /// <summary>
        /// Current status in service
        /// </summary>
        Service = 7,
        /// <summary>
        /// Current status stressed
        /// </summary>
        Stressed = 8,
        /// <summary>
        /// Current status  not recovered
        /// </summary>
        NonRecover = 9,
        /// <summary>
        /// Current status not contacted
        /// </summary>
        NoContact = 10,
        /// <summary>
        /// Current status lost comunication
        /// </summary>
        LostComm = 11
    }
}
